<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
 <title>蚌埠医学院志愿者招募</title>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta content="width=device-width, initial-scale=1" name="viewport" />
 <meta content="" name="description" />
 <meta content="" name="author" />
 <!-- BEGIN GLOBAL MANDATORY STYLES -->
 <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/plugins/bootstrap/css/bootstrap.css" type="text/css" >
 <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/plugins/font-awesome/css/font-awesome.css" type="text/css" > 
 <link    href="${pageContext.request.contextPath}/assets/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
 <link   href="${pageContext.request.contextPath}/assets/css/plugins.min.css" rel="stylesheet" type="text/css" />
 <link   href="${pageContext.request.contextPath}/assets/css/portal.login.min.css" rel="stylesheet" type="text/css" />
  <link   href="${pageContext.request.contextPath}/assets/plugins/layer/skin/default/layer.css" rel="stylesheet" type="text/css" />
 
 <link rel="shortcut icon" href="favicon.ico" /> 
 
 <style type="text/css">
   .logo{
      color:#fff;
      font-size:16px;
      font-weight:600;
   }
 </style>
 
 
</head>
    <body class=" login">
        <!-- BEGIN LOGO -->
        <div class="logo">
           		蚌埠医学院第一附属医院
        </div>
        <!-- END LOGO -->
        <!-- BEGIN LOGIN -->
        <div class="content">
            <!-- BEGIN LOGIN FORM -->
                <h3 class="form-title font-green">登录</h3>
                <div class="alert alert-danger display-hide">
                    <button class="close" data-close="alert"></button>
                    <span> 请输入用户名密码</span>
                </div>
                <div class="form-group">
                    <!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
                    <label class="control-label visible-ie8 visible-ie9">手机号</label>
                    <input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="手机号" id="phone_number" name="phone_number" /> </div>
                <div class="form-group">
                    <label class="control-label visible-ie8 visible-ie9">密码</label>
                    <input class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="密码"  id="password"  name="password" /> </div>
                <div class="form-actions">
                    <button type="submit" class="btn green uppercase" id="btn-login">登录</button>
                    <button type="submit" class="btn green uppercase" id="re-back">返回</button>
<!--                     <label class="rememberme check mt-checkbox mt-checkbox-outline">
                        <input type="checkbox" name="remember" value="1" />记住密码
                        <span></span>
                    </label> -->
                    <a href="javascript:;" id="forget-password" class="forget-password">忘记密码?</a>
                </div>
                <div class="create-account">
                    <p>
                        <a href="javascript:;" id="register-btn" class="uppercase">新用户注册</a>
                    </p>
                </div>
            <!-- END LOGIN FORM -->
            <!-- BEGIN FORGOT PASSWORD FORM -->
        </div>
        <div class="copyright"> 2017bengbu medical collage </div>
        
        <input type="hidden" id="reUrl" value="${reUrl}">
        <input type="hidden" id="code" value="${code}">

        <!--[if lt IE 9]>
<script src="../assets/global/plugins/respond.min.js"></script>
<script src="../assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
  <script src="${pageContext.request.contextPath}/assets/js/jquery-1.11.2.min.js" charset="utf-8" type="text/javascript"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/js/jquery.blockui.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/jquery-validation/js/jquery.validate.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/jquery-validation/js/additional-methods.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins/select2/js/select2.full.min.js"></script>
  <script src="${pageContext.request.contextPath}/assets/js/app.js"></script>
  <script src="${pageContext.request.contextPath}/assets/js/portal.login.js"></script>
  <script src="${pageContext.request.contextPath}/assets/plugins//layer/mobile/layer.js"></script>
    <script src="${pageContext.request.contextPath}/assets/plugins/layer/layer.js"></script>   
  
  <script type="text/javascript">
     var page={
    		 count:0,
    		 init:function(){
    			 this.initEvents();    			 
    		 },
    		 initEvents:function(){
    			 
    			 $("body").on("keydown",function(ev){
    				 if(ev.keyCode==13){
    					 if(page.count==0){
    						 page.count=1;
    						 $("#phone_number").focus();    						 
    					 }else if(page.count==1){
    						 $("#password").focus();
    						 page.count=2;
    					 }else if(page.count==2){
    						 page.count=0;
    						 $("#btn-login").click();
    					 }
    				 }
    			 })
    			 
    			 $("#phone_number").on("focus",function(){
    				 page.count=1;
    			 })
    			 $("#password").on("focus",function(){
    				 page.count=2;
    			 })    			 
    			 
    			 
    			 $("#re-back").on("click",function(){
    				 window.history.go(-1);
    			 })
    			 
    			 var that = this;    			 
    			 //跳转到注册页面
    			 $("#register-btn").on("click",function(){
    				 window.location.href="${pageContext.request.contextPath}/Portal/portalRegist.do"
    			 })
    			 //跳转到忘记密码页面
    			 $("#forget-password").on("click",function(){
    				 window.location.href="${pageContext.request.contextPath}/Portal/portalForgetPwd.do"
    			 })    	
    			 //登录跳转到主页
    			 $("#btn-login").on("click",function(){
    				 page.count=0;
    				 var params={};
    				 params.PASSWORD = $("#password").val();
    				 params.PHONE_NUMBER = $("#phone_number").val();
    				 
    				 if($.trim(params.PASSWORD)=="" || $.trim(params.PHONE_NUMBER)==""){
    					 layer.msg("用户名密码不能为空");
    					 return false;
    				 }    				     				 
        			 $.post("${pageContext.request.contextPath}/Portal/portal/LOG01.do?rnd="+Math.random(),params,function(result){
        				 if(result.state==1){
        					 layer.msg(result.msg);
        					 if($("#reUrl").val()=="volunteeApply"){
        						 window.location.href="${pageContext.request.contextPath}/Portal/volunteeApply.do?code="+$("#code").val()+"&rnd="+Math.random();
        					 }else{
        						 window.location.href="${pageContext.request.contextPath}/Portal/portalIndex.do?rnd="+Math.random();	 
        					 }        					         					
        				 } else {
        					 layer.msg(result.msg);
        					 return false;
        				 }        				 
        			 })
    			 })    	    			 
    			 return that;
    		 }
     }
     
     $(function(){    	 
    	 page.init();
     })
  </script>


</body>
</html>